<?php
include_once ("conn.php");
if(!isset($_GET['stu_id'])){
    die("非法访问！");
}
$stu_id=$_GET['stu_id'];
$sql = "select * from `student_info` where `stu_id`=$stu_id";// 从数据库查询id为$book_id的数据
$result = mysqli_query($conn,$sql);
$row = mysqli_fetch_assoc($result);
?>
<html>
<head>
    <title>修改学生信息</title>
</head>
<h1>修改学生信息</h1>
<form action="update.php" method="post">
    <table border="1" width="300">
        <tr>
            <th>学生姓名</th><td><input type="text" name="stu_name" value="<?php echo $row['stu_name'] ?>"></td>
        </tr>
        <tr>
            <th>学生分数</th><td><input type="text" name="stu_score" value="<?php echo $row['stu_score'] ?>"></td>
        </tr>
        <input type="text" name="stu_id" value="<?php echo $row['stu_id'] ?>" hidden>
        <tr>
            <td colspan="2" align="center"><input type="submit" name='submit' value="提交">&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="reset" value="取消" onclick="location.href=('index.php')"></td>
        </tr>
    </table>

</form>
</html>
